﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" Inherits="Pages_Boat_BoatItem" Codebehind="BoatItem.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="title" runat="Server">
    Boat management
</asp:Content>
<asp:Content ID="Using" ContentPlaceHolderID="using" runat="Server">
    <link rel="stylesheet" href="/css/colorpicker.css" type="text/css" />

    <script type="text/javascript" src="/js/colorpicker.js"></script>

    <script type="text/javascript" src="/js/eye.js"></script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="header" runat="Server">
    <a href="BoatList.aspx" title="Back Button"><span id="backbutton">Back</span></a>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="content" runat="Server">
    <div style="margin: 10px 3px 0 3px">
        <h1 style="text-indent: 10px">
            Add/Edit Boat</h1>
        <div style="margin: 15px">
            <div class="item">
                <div class="label">
                    Boat#:</div>
                <div class="field" style="width: 60%">
                    <asp:TextBox ID="txtBoatId" runat="server"></asp:TextBox>
                    <asp:Label ID="lblAlert" runat="server" ForeColor="Red" Visible="false">This boat exist! </asp:Label>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="This field is required."
                        InitialValue="" ControlToValidate="txtBoatId"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    Boat name:</div>
                <div class="field" style="width: 60%">
                    <asp:TextBox ID="txtBoatName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="This field is required."
                        InitialValue="" ControlToValidate="txtBoatName"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    N&#186; of cabins:</div>
                <div class="field" style="width: 60%">
                    <asp:TextBox ID="txtNumOfCabins" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="This field is required."
                        InitialValue="" ControlToValidate="txtNumOfCabins"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    N&#186; of floors:</div>
                <div class="field" style="width: 60%">
                    <asp:TextBox ID="txtNumOfFloors" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="This field is required."
                        InitialValue="" ControlToValidate="txtNumOfFloors"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    Active:</div>
                <div class="field">
                    <asp:CheckBox ID="cbActive" CssClass="checkbox" runat="server"></asp:CheckBox></div>
            </div>
            <div class="item">
                <div class="label">
                    Color:
                </div>
                <div class="field">
                    <input type="text" maxlength="6" size="6" id="txtColor" runat="server" readonly="readonly" /></p>
                </div>
            </div>
            <div class="item">
                <div class="label">
                    &nbsp
                </div>
                <div>
                    <asp:LinkButton CssClass="button" ID="btnSave" ToolTip="Save Button" runat="server"
                        OnClick="btnSave_Click"><span>Save</span></asp:LinkButton>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        (function ($) {
            var initLayout = function () {

                $("#<%=txtColor.ClientID %>").ColorPicker({
                    onSubmit: function (hsb, hex, rgb, el) {
                        $(el).val(hex);
                        $(el).ColorPickerHide();
                    },
                    onBeforeShow: function () {
                        $(this).ColorPickerSetColor(this.value);
                    }
                })

            };

            EYE.register(initLayout, 'init');
        })(jQuery)
    </script>

</asp:Content>
